package com.droid.network;

import java.util.Map;

import androidx.annotation.NonNull;
import io.reactivex.Observable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;

/**
 *
 * @author zhyuc
 * @since  2019/9/26 9:13
 */
public interface IHttp<T> {

    Observable<T> get(@NonNull String url, @NonNull Map<String, String> parameters);

    Observable<T> post(@NonNull String url, @NonNull Map<String, String> parameters);

    Observable<T> post(@NonNull String url, @NonNull RequestBody body);

    Observable<ResponseBody> upload(@NonNull String url, @NonNull RequestBody body);

    Observable<T> put(@NonNull String url, @NonNull RequestBody body);

    Observable<T> delete(@NonNull String url, @NonNull Map<String, String> parameters);

    default Observable<ResponseBody> sse(@NonNull String url){
        return null;
    }
}
